<script lang="ts" setup>
import { computed } from "vue"
import { useUserStore } from "@/store/modules/user"
import Admin from "./components/Admin.vue"
import User from "./components/User/index.vue"
import Company from "./components/Company.vue"

const userStore = useUserStore()
const [role] = userStore.roles

const cps = computed(() => {
  if (role === "admin") {
    return Admin
  } else if (role === "company") {
    return Company
  } else {
    return User
  }
})
</script>

<template>
  <component :is="cps" />
</template>
